// 框架模板，请勿修改
import { createApp, h } from 'vue'
import App from './App.vue'
import zh from "dayjs/locale/zh-cn"
import dayjs from 'dayjs'
dayjs.locale(zh);
import zh_CN from 'ant-design-vue/es/locale/zh_CN';
import { createPinia } from 'pinia';
import antd from 'ant-design-vue'

function appendStyle() {
    return new Promise((resolve, reject) => {
        // resolve();
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = '../libs/antd.dark.css'
        link.onload = resolve
        link.onerror = reject
        document.body.appendChild(link)
    })
};

appendStyle().then(() => {
    const app = createApp({
        render() {
            return h('a-config-provider', { '.locale': this.zh_CN }, [
                h(App)
            ])
        },
        data() {
            return { zh_CN: zh_CN }
        }
    });
    const pinia = createPinia()
    app.use(pinia)

    app.use(antd);
    app.mount('#app')
})

